package com.dowsure.apisaas.model;

import com.dowsure.apisaas.annotation.RequestParamValidated;
import com.dowsure.apisaas.enums.CurrencyEnums;
import com.dowsure.apisaas.enums.TermUnitEnums;
import com.dowsure.apisaas.util.DowsureDateUtils;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @description: 传输贷款支用数据请求参数
 * @author: Dowsure
 * @create: 2022-02-15 15:09
 **/
@Data
public class CreditLoanRequestParams {

    /**
     * Dowsure 卖家申请单编号
     */
    @RequestParamValidated(required = true, msg = "Dowsure 卖家申请单编号", maxLen = 32)
    private String applicationCode;

    /**
     * 用户侧资方授信编码
     */
    @RequestParamValidated(required = true, msg = "用户侧资方授信编码", maxLen = 32)
    private String creditCode;

    /**
     * 用户侧授信合同编号
     */
    @RequestParamValidated(msg = "用户侧授信合同编号", maxLen = 32)
    private String creditContractNo;

    /**
     * 用户侧贷款编号
     */
    @RequestParamValidated(required = true, msg = "用户侧贷款编号", maxLen = 32)
    private String loanCode;

    /**
     * 用户侧贷款合同编号
     */
    @RequestParamValidated(msg = "用户侧贷款合同编号", maxLen = 32)
    private String loanContractNo;

    /**
     * 支用金额
     */
    @RequestParamValidated(required = true, msg = "支用金额")
    private BigDecimal amount;

    /**
     * 支用开始时间 YYYY-MM-DD hh:mm:ss
     */
    @RequestParamValidated(required = true, msg = "支用开始时间", format = DowsureDateUtils.YYYYMMDDHHMMSS)
    private String startTime;

    /**
     * 支用结束时间 YYYY-MM-DD hh:mm:ss
     */
    @RequestParamValidated(required = true, msg = "支用结束时间", format = DowsureDateUtils.YYYYMMDDHHMMSS)
    private String endTime;

    /**
     * 期限
     */
    @RequestParamValidated(required = true, msg = "期限")
    private Integer term;

    /**
     * 周期 DAY ，MONTH， YEAR
     */
    @RequestParamValidated(required = true, msg = "周期")
    private TermUnitEnums termUnit;

    /**
     * 年利率
     */
    @RequestParamValidated(required = true, msg = "年利率")
    private BigDecimal apr;

    /**
     * 服务费
     */
    @RequestParamValidated(msg = "服务费")
    private BigDecimal processingFee;

    /**
     * 币种（[ISO 4217 currency codes](https://en.wikipedia.org/wiki/ISO_4217)） CNY（人民币）默认:CNY
     */
    @RequestParamValidated(msg = "币种")
    private CurrencyEnums currency;
}
